#ifndef __PROP_H_
#define __PROP_H_


#include "Global.h"
class Prop; //前置声明
//智能指针
using PropPtr = std::shared_ptr<Prop>;

//背包
class Prop
{
public:
    Prop(CSrRef Name, int Price):Name(Name),Price(Price){};
    DEFINE_MEMBER(Name, std::string)
    DEFINE_MEMBER(Price, int)
    DEFINE_MEMBER(attribute,std::string)
    virtual void show() = 0;
    //圆形模式：对象考培 拷贝当前一个指针对象
    virtual PropPtr clone() = 0;
    //判断道具种类
    //virtual void Getattribute() = 0;
};



//武器
class Weapon : public Prop
{
public:
    Weapon(CSrRef Name, int Price, int attack,float critChance,float dodgeChance,std::string attribute):Prop(Name, Price), Attack(attack),critChance(critChance),dodgeChance(dodgeChance),attribute(attribute){};
    //可以增加的攻击力
    DEFINE_MEMBER(attribute,std::string)
    DEFINE_MEMBER(Attack, int)
    DEFINE_MEMBER(critChance,float)
    DEFINE_MEMBER(dodgeChance,float)
    void show() override;
    PropPtr clone() override;
    // void Operator(){} override;
};

using WeaponPtr = std::shared_ptr<Weapon>;
//药品
class Potion : public Prop {
public:
    Potion(const std::string& name, int price, int healAmount,std::string attribute)
        : Prop(name, price), HealAmount(healAmount),attribute(attribute) {}

    void show() override; 

    PropPtr clone() override ;
    DEFINE_MEMBER(HealAmount,int)
    DEFINE_MEMBER(attribute,std::string)


};

using PotionPtr = std::shared_ptr<Potion>;
//防具
class Armor : public Prop {
public:
    Armor(const std::string& name, int price, int defense, float dodgeChance,std::string attribute)
        : Prop(name, price), Defense(defense), dodgeChance(dodgeChance),attribute(attribute) {}

    void show() override ;

    PropPtr clone() override ;

    DEFINE_MEMBER(Defense,int)
    DEFINE_MEMBER(dodgeChance,float)
    DEFINE_MEMBER(attribute,std::string)
};

using ArmorPtr = std::shared_ptr<Armor>;

//砖石
class Diamond:public Prop
{
public:
    Diamond(CSrRef Name, int Price, std::string attribute):Prop(Name, Price),attribute(attribute){};
    DEFINE_MEMBER(attribute,std::string)
    void show() override;
    PropPtr clone() override;
};



#endif